package cos470_assignment1

class Books {

	String title
	String author
	String description
	//String isbn
	Integer minGradeLvl
	Integer maxGradeLvl
	String language
	String category
	Date dateCreated
	Date lastUpdated
	
    static constraints = {
		title(unique:true)
		author(nullable:false)
		description(nullable:true)
		//isbn(nullable:true, matches: '~/(?:ISBN(?:-10)?:? )?(?=[-0-9X ]{13}$|[0-9X]{10}$)[0-9]{1,5}[- ]?(?:[0-9]+[- ]?){2}[0-9X]$/')
		minGradeLvl(inList:[0,1,2,3,4,5,6])
		maxGradeLvl(inList:[0,1,2,3,4,5,6])
		category(inList:['General Leisure Reading', 'Reading skills', 'Math skills', 'Health', 'Science'])
    }
}
